package com.xlkj.ms.tools.core.response;

/**
 * 该包装类有3个参数，分别为：code，msg，data，符合该响应类结构的接口可以继承该抽象类
 * <pre>
 * {@code
 * {
 *     "code":"***",
 *     "msg":"****",
 *     "data":{***}
 * }
 * }
 * </pre>
 * @author zhuqifeng
 * @date 2021/11/10 13:58
 * @package com.xlkj.ms.tools.core.response
 */
public abstract class AbstractResponseWrapper<T>  extends AbstractResponse {

    private static final long serialVersionUID = -6575584840209947219L;

    /** 具体的响应数据 */
    protected T data;

    public AbstractResponseWrapper() {}

    public AbstractResponseWrapper(String code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public AbstractResponseWrapper(String code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public AbstractResponseWrapper(T data) {
        this.data = data;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}